import request from './request'


// 闪卖
export function getFastSaleList(params){
  const data = params
  return request({
    url: '/app/h5/anonymous/appGoods/fastSaleList',
    method: 'post',
    data
  })
};

// 搜索结果
export function getAppGoodsList(params){
  return request({
    url:'/app/h5/anonymous/appGoods/search/goodsList',
    method: 'post',
    data:params
  })
};


// 推荐商品
export function getRecommendAppGoodsList(params){
  return request({
    url: '/app/h5/appGoods/recommendList',
    method: 'post',
    data:params
  })
};

export function getRecommendAppGoodsList2(params){
  return request({
    url: '/app/h5/anonymous/appGoods/recommendList',
    method: 'post',
    data:params
  })
};

// 查询商品留言
export function getMessageInfo(params){
  return request({
    url: '/app/h5/anonymous/appGoods/getMessageInfo',
    method: 'post',
    data:params
  })
};

// 获取会场商品信息
export function getNaviTemplateInfo(params){
  return request({
    url: '/app/h5/anonymous/appGoods/getNaviTemplateInfo',
    method: 'post',
    data:params
  })
};

export function getPayResult(params){
  return request({
    url: '/app/h5/order/getStatus/' + params.orderId,
    method: 'get',
    params:{}
  })
};

// 发布商品相关


// 获取商品详情
export function getGoodsInfo(params){
  return request({
    url: '/app/h5/appGoods/getGoodsInfo/'+ params.id,
    method: 'get',
    params:{}
  })
};
export function getGoodsInfo2(params){
  return request({
    url: '/app/h5/anonymous/appGoods/getGoodsInfo/'+ params.id,
    method: 'get',
    params:{}
  })
};


// 获取爱上街过来的商品详情
export function getThirdGoodsInfo(params){
  return request({
    url: '/app/third/goods/getThirdGoodsInfo',
    method: 'post',
    data:params
  })
};

// 获取app下载地址
export function getDownloadUrl(){
  return request({
    url: '/app/h5/anonymous/getDownloadUrl',
    method: 'get',
    params:{}
  })
};



// 获取一级分类
export function getRootCategory(params){
  return request({
    url: '/app/h5/anonymous/appGoods/category/getRootCategory',
    method: 'get',
    params
  })
};

// 根据父级类目获取子级类目
export function getCateByParentId(params){
  return request({
    url: '/app/h5/anonymous/appGoods/category/getByParentId/' + params.parentId,
    method: 'get',
    params:{}
  })
};

// 根据id获取单个分类条目详情
export function getCateInfoById(params){
  return request({
    url: '/app/h5/anonymous/appGoods/category/info/' + params.id,
    method: 'get',
    params:{}
  })
};

// 获取标签列表
export function getTagList(params){
  return request({
    url: '/app/h5/anonymous/appGoods/tag/list',
    method: 'post',
    data:params
  })
};

// 发布商品
export function uploadGoods(params){
  return request({
    url: '/app/h5/appGoods/release',
    method: 'post',
    data:params
  })
};



// 下架商品
export function appGoodsPutDown(params){
  return request({
    url: '/app/h5/appGoods/putDown',
    method: 'post',
    data:params
  })
};

// 降价
export function appGoodsUpdatePrice(params){
  return request({
    url: '/app/h5/appGoods/updatePrice',
    method: 'post',
    data:params
  })
};

// 删除
export function appGoodsRemove(params){
  return request({
    url: '/app/h5/appGoods/remove',
    method: 'post',
    data:params
  })
};

// 获取我的收藏列表
export function getMyGoodsCollections(params){
  const data = params
  return request({
    url: '/app/h5/appGoods/getMyGoodsCollections',
    method: 'post',
    data
  })
};

// 取消收藏
export function cancelCollection(params){
  const data = params
  return request({
    url: '/app/h5/appGoods/goodsCollection',
    method: 'post',
    data
  })
};